import Vue from 'vue'
import './cube-ui'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import '@/assets/css/index.scss' // global css
// 移动端适配
import 'lib-flexible/flexible.js'
import App from './App'
import store from './store'
import router from './router'
import '@/filters' // filters
import '@/utils/directives' // directives
import '@/permission' // permission control
import wechatAuth from './plugins/wechatAuth' // 微信登录插件
import moment from 'moment';
Vue.prototype.$moment = moment;
import 'vue-ydui/dist/ydui.base.css';

import {
  LightBox,
  LightBoxImg,
  LightBoxTxt
} from "vue-ydui/dist/lib.rem/lightbox";
Vue.component(LightBox.name, LightBox);
Vue.component(LightBoxImg.name, LightBoxImg);
Vue.component(LightBoxTxt.name, LightBoxTxt);

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
// 日历
import VCalendar from 'v-calendar';
Vue.use(VCalendar);
// 弹出层提示插件
import Tip from '@/components/tip'
Vue.use(Tip)

// 设置appid
Vue.use(wechatAuth, {
  appid: process.env.VUE_APP_WECHAT_APPID
})
// 手机端调试工具
// import VCconsole from 'vconsole'
// Vue.use(VCconsole)


// 货币过滤器
Vue.filter('currency', function (value) {
  if (value) {
    value = parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
    return value;
  } else {
    return 0.00
  }
})
// 时间过滤器
Vue.filter('dateFormat', function (value) {
  return moment(value).format('YYYY-MM-DD');
})


Vue.config.productionTip = false



new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
